package com.xugongzhang.springcloud.alibaba.service;

import com.xugongzhang.springcloud.alibaba.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author X
 * @date 2022/6/19 2:46
 */
@FeignClient(value = "seata-storage-service")
public interface StorageService {
    /**
     * 调用另一个服务,减库存
     * @param productId 商品id
     * @param count 购买的数量
     * @return 结果
     */
    @PostMapping("/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId,
                          @RequestParam("count") Integer count);
}
